<?php
/**
 * Short Description  
 *
 * Long Description 
 *
 * @category   
 * @package    
 * @subpackage 
 * @copyright 
 * @author     Sandeep Manne<sandeep.manne@costrategix.com>
 */

class PaymentForm extends Core_Form
{
	public function __construct()
	{
		parent::__construct($options);
		
		$ccardType = $this->createElement('select', 'CREDITCARDTYPE')
	        				->setLabel("Type")
	        				->setRequired(true);
		$ccardType->addMultiOptions(array('Visa'       => 'Visa',
										  'MasterCard' => 'MasterCard',
										  'Discover'   => 'Discover',
										  'Amex'       => 'Amex'));
		$ccardNumber = $this->createElement('text', 'ACCT')
	        				->setLabel("Credit Card Number")
	        				->setRequired(true)
		                    ->addValidator('CreditCard')
		                    ->addErrorMessage('Invalid Credit Card Number'); 
		           
		$expirationDate = $this->createElement('text', 'EXPDATE')
	        				    ->setLabel("Expiration Date (MMYYYY)")
	        				    ->setRequired(true)
		                        ->addValidator('Digits')
		                        ->addErrorMessage('Invalid Month');

		$cvvNumber = $this->createElement('text', 'CVV2')
        			   ->setLabel("CVV")
        			   ->setRequired(true)
                       ->addValidator('Digits')
                       ->addErrorMessage('Invalid Year');
                       
		$fname  = $this->createElement('text', 'FIRSTNAME')
        			   ->setLabel("First Name")
        			   ->setRequired(true)
                       ->addErrorMessage('Invalid Name');    

        $lname  = $this->createElement('text', 'LASTNAME')
        			   ->setLabel("Last Name")
        			   ->setRequired(true)
                       ->addErrorMessage('Invalid Name'); 
        
		$street = $this->createElement('text', 'STREET')
        			   ->setLabel("Street")
        			   ->setRequired(true); 

		$city  = $this->createElement('text', 'CITY')
        			   ->setLabel("City")
        			   ->setRequired(true);
        			   
		$state  = $this->createElement('text', 'STATE')
        			   ->setLabel("State")
        			   ->setRequired(true);
        			   
		$countryCode  = $this->createElement('text', 'COUNTRYCODE')
	        			   ->setLabel("Country Code")
	        			   ->setRequired(true);
	        			   
		$zip  = $this->createElement('text', 'ZIP')
	        			   ->setLabel("Zip")
	        			   ->setRequired(true);
        			   
		$submit = $this->createElement("submit", "submit")->removeDecorator('Label');
		                       
		$this->addElements(array($ccardType, $ccardNumber, $expirationDate, 
		                 		 $cvvNumber, $fname, $lname, $street,
		                 		 $city, $state, $countryCode, $zip,
		                 		 $submit));
	}
}